<script setup>
import { ref, onMounted } from 'vue'
import { myActiveListAPI } from '@/api/login'

const listData = ref([])
const getList = async () => {
  try {
    const res = await myActiveListAPI()
    listData.value = res.data
  } catch (error) {
    const { code, msg } = error
    if (code != '401') {
      uni.showToast({ title: msg, icon: 'none' })
    }
  }
}

onMounted(() => {
  getList()
})
</script>

<template>
  <view class="my-active">
    <template v-for="(item, index) in listData" :key="index">
      <fes-active-card :obj="item"></fes-active-card>
    </template>
    <no-data v-if="listData.length == 0" />
  </view>
</template>

<style lang="scss" scoped>
.my-active {
  padding: 44rpx 28rpx;
  min-height: 100vh;
  background: #f5f5f5;
}
.limit2 {
  overflow: hidden;
  word-break: break-all;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.limit3 {
  overflow: hidden;
  word-break: break-all;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
</style>
